/*
 * @Author: 卡卡 1071780426@qq.com
 * @Date: 2022-08-15 14:23:50
 * @LastEditors: 卡卡 1071780426@qq.com
 * @LastEditTime: 2022-09-04 15:32:56
 * @FilePath: \qualitymeasurement\src\main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import * as echarts from 'echarts'
import "echarts-gl";
import "echarts/lib/chart/pie"


import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
// 引入公共样式
import "./assets/css/global.css";
import './assets/css/font/iconfont.css'

// 滚动
import scroll from "vue-seamless-scroll";
Vue.use(scroll);
// import axios from "axios";



// 图表自适应
Vue.prototype.$echartsResize = function(ref) {
  // console.log(66,ref)
  window.addEventListener("resize", function() {
    console.log(77,ref)
      ref.resize();
  });
};


// window.addEventListener('resize', () => {
//   this.charts.resize() // 多个图表，第一个图表
// })


// rem自适应
function setRem() {
  var whdef = 100 / 1920; // 表示1920的设计图,使用100PX的默认值
  var bodyWidth = document.body.clientWidth; // 当前窗口的宽度
  var rem = bodyWidth * whdef; // 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
  document.getElementsByTagName("html")[0].style.fontSize = rem + "px";
}
window.addEventListener("load", setRem);
window.addEventListener("resize", setRem);

// axios.defaults.baseURL = "http://cloud.limsapp.cn/scyj/cloudapi/";
// Vue.prototype.$http = axios;

Vue.config.productionTip = false
Vue.prototype.$echarts = echarts;
// console.log(555,this.$echarts)
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>',
  mounted() {
    setRem();
}
})
